package entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import data.SeasonEnum;

@Entity
@Table(name="SEMESTERS")
@NamedQuery(name="Semesters.findAll", query="SELECT s FROM Semesters s")
public class Semesters implements Serializable {
	
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="SEM_ID")
	private Long id;
	@Column(name="SEM_NAME", nullable=false, length=50, unique=true)
	private String name;
	@Column(name="SEM_YEAR", nullable=false)
	private int year;
	@Column(name="SEM_SEASON", nullable=false)
	@Enumerated(EnumType.STRING)
	private SeasonEnum season;
	
	public Semesters() {}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public SeasonEnum getSeason() {
		return season;
	}

	public void setSeason(SeasonEnum season) {
		this.season = season;
	}
	
   
}
